
public class BB {

    public BB(/*String name,int age*/) {
        System.out.println("BB构造函数");
    }
    static {
        System.out.println("BB静态代码块");
    }
    {
        System.out.println("BB实例代码块");
    }

    public void eat() {
        System.out.println("chi");
    }

}

class AA extends BB{
    //    String name;
//    int age;
    public AA(/*String name, int age*/) {
//        this.name = name;
//        this.age = age;
        System.out.println("AA构造函数");

    }

    static {
        System.out.println("AA静态代码块");
    }
    {
        System.out.println("AA实例代码块");
    }


}

class Test {
    public static void main(String[] args) {

        new AA();
        System.out.println("------");
        new AA();
        System.out.println("--------");
        BB b = new AA();

    }

    public static void C(BB b1) {

    }
}
